from time import time
import requests
from requests.auth import HTTPBasicAuth
from config.secure import ES_URI
from models.base import db
from models.order_info import orders_info
import json

# print(time())
data = {
    "query": {
        "match": {
            "content": {
                "query": "刑诉法272条第一款规定\"在附条件不起诉的考验期内,人民检察院对被附条件不起诉的未成年犯罪嫌疑人进行监督考察\"。"
            }
        }
    },
    "highlight": {
        "fields": {
            "content": {
                "pre_tags": [
                    "<em>"
                ],
                "post_tags": [
                    "</em>"
                ]
            }
        }
    },
    "from": -1,
    "size": 20
}
headers = {
    'content-type':'application/json'
}
res = requests.get(ES_URI, json=data, headers=headers,auth=HTTPBasicAuth('xiaohengheng', '950218'))
res_dict = json.loads(res.text)
print(json.loads(res.text))
